<?php
// +----------------------------------------------------------------------
// | 名片应用
// | Author: 张亚 < zhyacn@gmail.com>
// +----------------------------------------------------------------------
namespace api\businesscard\model;

use api\common\model\CommonModel;
use think\Model;

class BusinessCategoryModel extends CommonModel {

	protected $type = [
		'more' => 'array',
	];

	//模型关联方法
	protected $relationFilter = ['cards'];

	/**
	 * 关联名片表
	 * @return $this
	 */
	public function cards() {
		return $this->belongsToMany('BusinessCardModel', 'business_category_card', 'post_id', 'category_id');
	}
}